package com.bestcem.xm.cjm.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.bestcem.xm.cjm.entity.CjmColumns;
import com.bestcem.xm.cjm.mapper.CjmColumnsMapper;
import com.bestcem.xm.cjm.service.CjmColumnsService;
import com.bestcem.xm.common.core.domain.web.XmResultJson;
import com.bestcem.xm.component.mybatis.service.impl.XmServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class CjmColumnsServiceImpl extends XmServiceImpl<CjmColumnsMapper, CjmColumns> implements CjmColumnsService {

    @Override
    public XmResultJson<?> updateColumns(String id, JSONObject param) {
        CjmColumns updte = param.toJavaObject(CjmColumns.class);
        updte.setId(id);
        baseMapper.updateById(updte);

        JSONObject ret = new JSONObject();
        ret.put("id", id);
        return XmResultJson.success(ret);
    }
}
